package com.sunrise.gateway.commons;

import javax.servlet.http.HttpServletRequest;

/**
 * @author wangmin
 * @discription
 * @created 2020-04-10 9:56
 */
public abstract class GatewayServletContext {
    private static final ThreadLocal<HttpServletRequest> httpRequestThreadLocal = new ThreadLocal<>();
    public static HttpServletRequest getHttpRequest() {
        return httpRequestThreadLocal.get();
    }
    public static void setHttpRequest(HttpServletRequest value) {
        if (null != value) {
            httpRequestThreadLocal.set(value);
        }
    }
    public static void removeHttpRequest() {
        httpRequestThreadLocal.remove();
    }
}
